#include"string.h"

namespace jyz
{
	void test1()
	{
		jyz::string s("hello world");
		cout << s.c_str() << endl;
		cout << s.size() << endl;
		for (int i = 0; i < s.size(); i++)
		{
			cout << s[i] << " ";
		}
		cout << endl;

		for (auto& e : s)
		{
			cout << e << " ";
		}
		cout << endl;

		jyz::string::iterator it1 = s.begin();
		while (it1 != s.end())
		{
			cout << *it1 << " ";
			it1++;
		}
	}

	void test2()
	{
		const string s("XXXXXXXXX");
		string::const_iterator it = s.begin();
		while (it != s.end())
		{
			/**it = 'y';*/
			cout << *it << " ";
			it++;
		}
		for (int i = 0; i < s.size(); i++)
		{
			//s[i]++;
			cout << s[i] << " ";
		}
		cout << endl;
	}
	void test3()
	{
		//string s("XXXXXXXXX");
		//cout << s.c_str() << endl;
		//s.push_back('y');
		//cout << s.c_str() << endl;
		//s.append("ZZZZ");
		//cout << s.c_str() << endl;
		//s += "uUUUU";
		//cout << s.c_str() << endl;
		//s += 'w';
		//cout << s.c_str() << endl;
		//s.insert(0, 'a');
		//cout << s.c_str() << endl;
		//s.insert(9, 'a');
		//cout << s.c_str() << endl;
		//s.insert(0, "AAA");
		//cout << s.c_str() << endl;
		//s.erase(0, 4);
		//cout << s.c_str() << endl;
	}

	void test4()
	{
		string s("abcdefghijklmn");
		//cout << s.find('c') << endl;
		//cout << s.find("jkl") << endl;
		//string s1(s);
		//cout << s1.c_str() << endl;
		//string s1;
		//s1 = s;
		//cout << s1.c_str() << endl;
		//string s2 = "20050808";
		//cout << s2.c_str() << endl;
		//swap(s1, s2);
		//cout << s1.c_str() << endl;
		//cout << s2.c_str() << endl;
		//string s1 = s.substr(0, 5);
		//cout << s1.c_str() << endl;

	}

	void test5()
	{
		//string s1,s2;
		//cin >> s1>>s2;
		//cout << s1<<s2;
		//cout << (s1 < s2) << endl;
		//cout << (s1 <= s2) << endl;
		//cout << (s1 > s2) << endl;
		//cout << (s1 >= s2) << endl;
		//cout << (s1 == s2) << endl;
		//cout << (s1 != s2) << endl;
		string s1("wjt");
		string s2(s1);
		string s3 = s2;
		cout << s1 << s2 << s3 << endl;
	}
}

	int main()
	{
		jyz::test5();
		return 0;
	}
